﻿using System;
using System.Data;
using System.Collections.Generic;
using EnterpriseFund.Model;

namespace EnterpriseFund.BLL
{
    public partial class QueryHREmpl
    {

        private readonly EnterpriseFund.DAL.QueryHREmpl dal = new EnterpriseFund.DAL.QueryHREmpl();
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.HREmpl> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.HREmpl> DataTableToList(DataTable dt)
        {
            List<EnterpriseFund.Model.HREmpl> modelList = new List<EnterpriseFund.Model.HREmpl>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                EnterpriseFund.Model.HREmpl model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

    }
}
